package com.aaa.system.controller;

import com.aaa.entity.Admin;
import com.aaa.system.service.AdminService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: qy158-cai-parent
 * @description:
 * @author: 闫克起2
 * @create: 2023-02-22 17:13
 **/
@RestController
@RequestMapping("system/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @GetMapping("/getByName/{name}")
    public Admin getByName(@PathVariable String name){
        QueryWrapper<Admin> wrapper=new QueryWrapper<>();
        wrapper.eq("admin_username",name);
        Admin admin = adminService.getOne(wrapper);
        return admin;
    }
}
